import request  from '@/utils/request';

import { BASE_URL } from '@/config/query';

export async function queryPage(params = { pageSize: 8, pageNum: 0 }) {
  return request(`${BASE_URL}/fire_room/page`, params)
}

export async function queryInfoById(id) {
  return request(`${BASE_URL}/fire_room/detail/${id}`)
}

export async function create(params) {
  return request(`${BASE_URL}/fire_room/create`, params)
}

export async function update(params) {
  return request(`${BASE_URL}/fire_room/modify`, params)
}

export async function remove(id) {
  return request(`${BASE_URL}/fire_room/remove/${id}`)
}

export async function queryBuildPage(params) {
  return request(`${BASE_URL}/build/page`, params)
}

export async function queryOptionList(params) {
  let url = params.url;
  delete params.url;
  return request(`${BASE_URL}/${ url }`, params)
}

export async function queryLocationList() {
  return request(`${BASE_URL}/build/list`)
}